'''
Author: your name
Date: 2021-04-01 16:39:28
LastEditTime: 2022-02-15 14:12:40
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \genetic-algorithm-optimization\main.py
'''
from env.environment import *
from GA import *
# from scikitopt.MyGA import *
import time

if __name__ == "__main__":
    starttime = time.time()
    env = Env()
    a = GA(100, 20, 104, 0.8, 0.1, env)
    a.GA_main()
    # myGA = MyGA(10000, 100, 104, 0.8, 0.001, env)
    # myGA.run()
    # bios = [0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0,
    #         0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0,
    #         0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0,
    #         1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1,
    #         1, 1, 0, 1, 0, 0, 0, 1]
    # _, result = env.step_online(bios)
    # print(-result)
    # 275151.9
    endtime = time.time()
    print("Runtime = " + str(endtime - starttime))
